{% extends 'base.twig' %}
{% block content %}
	<div class="modal fade" id="modalWindow" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content"></div>
		</div>
	</div>

	<a href="/admin/users/add" class="btn btn-primary" data-toggle="modal" data-target="#modalWindow">
		<span class="glyphicon glyphicon-plus-sign"></span> Добавить пользователя
	</a>

	<table class="table table-striped table-hover">
        <thead>
        <tr>
            <th>LOGIN</th>
            <th>Посл. вход</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        {% for user in users %}
            <tr class="{{ cycle(['row1','row2'], loop.index0) }}">
                <td>{{ user.login }}</td>
                <td>{{ user.last_login }}</td>
                <td>
                    <a href="/admin/users/edit?login={{ user.login }}" class="btn btn-default btn-xs" data-toggle="modal" data-target="#modalWindow"><span class="glyphicon glyphicon-pencil"></span> Редактировать</a>
					<a data-href="/admin/users/delete?login={{ user.login }}" data-text="Удалить пользователя?" class="btn btn-default btn-xs" data-toggle="modal" data-target="#confirmBox"><span class="glyphicon glyphicon-remove"></span> Удалить</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
{% endblock %}